<?php 

$mktime=mktime(date('his'));
$tr=$mktime.'tr';
$divlistado=$mktime.'listado';
$carg=$mktime;
$i_edit = $this->For->img('iconos/icons/editar.png');
$i_bor = $this->For->img('iconos/icons/borrar.png');
$i_nuevo = $this->For->img('iconos/icons/nuevo.png');
$i_ver = $this->For->img('iconos/icons/grid.png');
$i_pdf= $this->For->img('iconos/icons/pdf.png');
$i_pdf2= $this->For->img('iconos/icons/pdf.png');
echo "<div id='$divlistado'><br /><br />";
?>
<table border='0' cellpadding='0' cellspacing='0' width='95%' align='center' style='border:10;'>
	<tr>
		<td>&nbsp;</td>
		<td width='62px'>
			<?=$this->Json->tipsayuda('nuevo1','Haga Click para registrar un nuevo Productor','nuevo');?>
			<div align='right' id='nuevo1' style="border-top: #999999 0px solid; border-left: #999999 0px solid; border-right: #999999 0px solid;">
				<div onclick="<?=$this->For->ajax('','TARJETAPRODUCTIVA/nuevo/nuevo1/'.$divlistado,$carg);?>">
						&nbsp;<?=$this->For->accion($i_nuevo);?>
				</div>
			</div>
		</td>
	</tr>
	<tr>
		<td colspan='2'>
		<?
				$this->Json->tipsayuda($tr,'Haga Doble Click sobre el listado para ampliar','listado');
				$this->Json->lisamplia('t'.$mktime);
				if(count($data)>0) 
				{
						$this->For->table($mktime);
						$this->For->tr($mktime,'',$tr,1);
						$this->For->td('<b>#</b>','','c','20px');
						$this->For->td('<b>CED.ó RIF</b>','','c','30px');
						$this->For->td('<b>NOMBRE</b>','','c');
						$this->For->td('<b>APELLIDO</b>','','c');
						$this->For->td('<b>DIRECCION</b>','','c');
						//$this->For->td('<b>FECHA N.</b>','','c');
						//$this->For->td('<b>SEXO</b>','','c');
						$this->For->td('<b>CELULAR</b>','','c','100px');
						//$this->For->td('<b>ESTATUS</b>','','c');
						$this->For->td('<b>ACCION</b>','','c','10px');
						$this->For->tr('');
						for($z=0; $z<count($data); $z++)
						{ 
								$mode='Productor';
								if ($z % 2 == 0) $class = "#FFFFFF"; else $class = "#F0F0F0";
								$id=$this->For->id('',$data[$z][$mode]['id']);
								$t1=$id.'ayuda';
								$t2=$id.'links';
								$pre=$id.'preg';
								$num=$this->For->armar_numero(($z+1));
								$a=$data[$z][$mode]['ced_rif'];
								$b=$data[$z][$mode]['nombre'];
								$c=$data[$z][$mode]['apellido'];
								$d=$data[$z]['Estado']['nombre']."/".$data[$z]['Municipio']['nombre']."/".$data[$z]['Parroquia']['nombre']."/".$data[$z]['Productor']['direccion'];
								$e=$this->For->fecha($data[$z][$mode]['fecha_nacimiento']);
								$f=$data[$z][$mode]['sexo'];
								$h=$data[$z][$mode]['estatus'];
								$g=$data[$z][$mode]['tlf_celular'];
								$this->Json->tipsayuda($t1,"$num $a $b $c $e <br />Telefono: $g <br />Direccion: $d ",'info',500);
		

					
								$this->For->tr($mktime,$class,$t1);
								$this->For->td($num,$busq,'r');
								$this->For->td($a,$busq);
								$this->For->td($b,$busq);
								$this->For->td($c,$busq);
								$this->For->td($d,$busq,'','','',"a$z",40);
								//$this->For->td($e,'','c');
								//$this->For->td($f,$busq);
								$this->For->td($g,'');
								//$this->For->td($h,'');

	$eve_ver=$this->For->ajax('',"TARJETAPRODUCTIVA/ver_dato_productor/$t2/$divlistado/2/$id",$carg);
	$eve_edit=$this->For->ajax('',"TARJETAPRODUCTIVA/ver_dato_productor/$t2/$divlistado/1/$id",$carg,null,array($pre.$z,'¿DESEAS MODIFICAR LOS DATOS DEL PRODUCTOR?'));
	 echo "<td id='$t2'>"; 
				?>
<?=	$this->Json->tipsayuda("ver_csdwerrewe$z","$num $a",'ver',100);?>
<?=	$this->Json->tipsayuda("editar_csdwerrewe$z","$num $a",'modi',100);?>
<?=	$this->Json->tipsayuda("pdf_csdwerrewe$z","$num $a",'pdf',120);?>
<?=	$this->Json->tipsayuda("pdf_csdwerrewerrr$z","$num $a",'pdf',120);?>
<table border='0' cellpadding='0' cellspacing='0' width='95%' align='center'>
   <tr>
	<td id="ver_csdwerrewe<?=$z?>">
		<a onclick="<?=$eve_ver;?>">&nbsp;<?=$this->For->accion($i_ver);?></a>
	</td>
	<td id="editar_csdwerrewe<?=$z?>">
		<a id="<?=$pre.$z;?>" onclick="<?=$eve_edit;?>"><?=$this->For->accion($i_edit);?></a>
	</td>
	<td id="pdf_csdwerrewe<?=$z?>">
		<a href="TARJETAPRODUCTIVA/pdf_produtor/<?=$id?>" onClick="window.open(this.href,'ayuda','width=900,height=600'); return false;" style="text-decoration:none;">
<?=$this->For->accion($i_pdf);?></a>
	</td>
	<td id="pdf_csdwerrewerrr<?=$z?>">
		<a href="TARJETAPRODUCTIVA/pdf_produtor_html/<?=$id?>" onClick="window.open(this.href,'ayuda','width=900,height=600'); return false;" style="text-decoration:none;">
<?=$this->For->accion($i_pdf2);?></a>
	</td>
   </tr>
</table>



<?="</td>";
								$this->For->tr('');
//'onclick'=>"imprimir('TARJETAPRODUCTIVA/pdf_produtor_html','id_imprimir');"
						} 
						$this->For->table('');
				}
				else 
				{
						$this->For->table($mktime);
						$this->For->tr($mktime,'#FFFFFF',$tr);
						$this->For->td("<font color='red' size='-1'>No Se Encrontraron Registros con esa Busqueda </font>",'','c','100%');
						$this->For->tr('');
						$this->For->table('');
				}
				?>
		</td>
	</tr>

<?php
	if(count($data)>20) 
	{ 
?>
		<tr>
			<td>&nbsp;</td>
			<td width='62px'>
					<?=$this->Json->tipsayuda('nuevo2','Haga Click para registrar un nuevo Productor','nuevo');?>
					<div align='center' id='nuevo2' style="border-bottom: #999999 0px solid; border-left: #999999 0px solid; border-right: #999999 0px solid;">
						<div onclick="<?=$this->For->ajax('','TARJETAPRODUCTIVA/nuevo/nuevo2/'.$divlistado,$carg);?>">&nbsp;<?=$this->For->accion($i_nuevo);?></div>
					</div>
			</td>
		</tr>
<? } ?>
</table>
<? echo '<br /><br />'; echo'</div>';?>
<?="<div id='$carg'></div>";?>

